home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 23 / AACD 23.iso / AACD / Programming / tek / visual / drawrgb.c < prev    next >
C/C++ Source or Header  |  2001-05-12  |  907b  |  43 lines

  1.  
  2. #include "tek/visual.h"
  3. #include "tek/debug.h"
  4. #include "tek/kn/visual.h"
  5.  
  6. /* 
  7. **    TEKlib
  8. **    (C) 2001 TEK neoscientists
  9. **    all rights reserved.
  10. **
  11. **    TVOID TVDrawRGB(TAPTR visual, TINT x, TINT y, TUINT *buffer, TINT w, TINT h, TINT totw)
  12. **
  13. **    draw rgb array
  14. */
  15.  
  16. TVOID TVDrawRGB(TAPTR visual, TINT x, TINT y, TUINT *buffer, TINT w, TINT h, TINT totw)
  17. {
  18.     TVISUAL *v = (TVISUAL *) visual;
  19.     TDRAWMSG *msg;
  20.  
  21.     for (;;)
  22.     {
  23.         if ((msg = TGetMsg(v->asyncport)))
  24.         {
  25.             msg->jobcode = TVJOB_DRAWRGB;
  26.             msg->op.rgb.rgbbuf = buffer;
  27.             msg->op.rgb.x = x;
  28.             msg->op.rgb.y = y;
  29.             msg->op.rgb.w = w;
  30.             msg->op.rgb.h = h;
  31.             msg->op.rgb.totw = totw;
  32.  
  33.             TSendMsg(v->parenttask, TTaskPort(v->task), msg);            
  34.  
  35.             kn_lock(&v->asyncport->lock);
  36.             TAddTail(&v->asyncport->msglist, (TNODE *) (((TMSG *) msg) - 1));
  37.             kn_unlock(&v->asyncport->lock);
  38.             return;
  39.         }
  40.         TWaitPort(v->asyncport);        /* wait for free node */
  41.     }
  42. }
  43.